<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>波仔的学习之旅-2</title>
</head>

<body>
    <div id="app">
        <!-- 上一页在 第一张图片即下标为0时隐藏  <=0 隐藏 -->
        <button @click="i--" v-show="i>0">上一页</button>
        <div>
            <!-- 显示第一张图片 -->
          <img v-bind:src="list[i]" alt="">
        </div>
        <!-- 下一页在 最后一张图片即下标为5时隐藏  >=5时 隐藏 -->
        <button @click="i++" v-show="i<5">下一页</button>
      </div>
      <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
      <script>
        const app = new Vue({
          el: '#app',
          data: {
            // i为下标默认为0 显示第一张图片
            i:0,
            list: [
              './imgs/11-00.gif',
              './imgs/11-01.gif',
              './imgs/11-02.gif',
              './imgs/11-03.gif',
              './imgs/11-04.png',
              './imgs/11-05.png',
            ]
          }
        })
      </script>
</body>

</html>